import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';

export const columns: BasicColumn[] = [
    {
    title: '警唯一标识',
    dataIndex: 'serialNumber'
   },
   {
    title: '告警关联的点位对象guid',
    dataIndex: 'guid'
   },
   {
    title: '消息类型。1=触发，2=恢复',
    dataIndex: 'msgType'
   },
   {
    title: '告警产生/恢复时间,UNIX时间戳（秒级',
    dataIndex: 'time'
   },
   {
    title: '告警内容。最大长度1024字节',
    dataIndex: 'content'
   },
   {
    title: '告警级别',
    dataIndex: 'alarmLevel'
   },
   {
    title: 'alarmType',
    dataIndex: 'alarmType'
   },
   {
    title: '关联监点位的当前值',
    dataIndex: 'snapshot'
   },
   {
    title: '告警处理建议',
    dataIndex: 'suggestion'
   },
   {
    title: '删除状态',
    dataIndex: 'delFlag'
   },
];

export const searchFormSchema: FormSchema[] = [
 {
    label: '告警序列号',
    field: 'serialNumber',
    component: 'Input'
  },
 {
    label: '告警关联的点位对象guid',
    field: 'guid',
    component: 'Input'
  },
  {
    label: '告警级别',
    field: 'alarmLevel',
    component: 'JDictSelectTag',
    componentProps: {
      dictCode: 'alarm_level',
      placeholder: '请选择告警级别',
      stringToNumber: true,
    },
    
  },
];

export const formSchema: FormSchema[] = [
  // TODO 主键隐藏字段，目前写死为ID
  {label: '', field: 'id', component: 'Input', show: false},
  {
    label: '告警序列号',
    field: 'serialNumber',
    component: 'Input',
  },
  {
    label: '告警关联的点位对象guid',
    field: 'guid',
    component: 'Input',
  },
  {
    label: '消息类型。1=触发，2=恢复',
    field: 'msgType',
    component: 'Input',
  },
  {
    label: '告警产生/恢复时间,UNIX时间戳（秒级',
    field: 'time',
    component: 'InputNumber',
  },
  {
    label: '告警内容。最大长度1024字节',
    field: 'content',
    component: 'Input',
  },
  {
    label: '告警级别',
    field: 'alarmLevel',
    component: 'InputNumber',
  },
  {
    label: 'alarmType',
    field: 'alarmType',
    component: 'InputNumber',
  },
  {
    label: '关联监点位的当前值',
    field: 'snapshot',
    component: 'Input',
  },
  {
    label: '告警处理建议',
    field: 'suggestion',
    component: 'Input',
  },
  {
    label: '删除状态',
    field: 'delFlag',
    component: 'InputNumber',
  },
];
